package com.gitee.chenyaohua.demo.mybatis.encryption.decryption.action;

import com.gitee.chenyaohua.demo.mybatis.encryption.decryption.dao.TUserMapper;
import com.gitee.chenyaohua.demo.mybatis.encryption.decryption.entity.TUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.UUID;
import java.util.concurrent.ThreadLocalRandom;

@RestController
public class UserAction {

    @Autowired
    private TUserMapper userMapper;

    @RequestMapping("add")
    public void add(){

        TUser tUser = new TUser();
        tUser.setUserPasswrod("暂时");
        tUser.setUserId(UUID.randomUUID().toString());
        tUser.setUserEamil(ThreadLocalRandom.current().toString());
        tUser.setUserName("12#");
        tUser.setUserSex("1");
        tUser.setCreateDate(new Date());
        tUser.setUpdateDate(new Date());
        userMapper.insertSelective(tUser);
    }

}
